﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace WebApp
{
    public partial class Login : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void dlBtn_Click(object sender, EventArgs e)
        {
            var name = userTxb.Text.Trim();
            var pwd = pwdTxb.Text.Trim();

            string sql =string.Format( "select * from Userinfo where UserName='{0}' and Pwd='{1}'",name,pwd);
            var table = DbHelper.GetData(sql);

            if (table.Rows.Count > 0)
            {
                Label4.Visible = false;
                Response.Redirect("Default.aspx");
            }
            else
            {
                Label4.Text = "用户名或者密码错误！！";
                Label4.Visible = true;
            }

        }

        protected void tcBtn_Click(object sender, EventArgs e)
        {

        }
    }
}